package com.yykj.hospital.server.model.repository.banci;

import com.yykj.common.enums.BanCiType;
import com.yykj.hospital.server.model.entity.banci.HospitalBanCi;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HospitalBanCiRepository extends JpaRepository<HospitalBanCi,Integer>, JpaSpecificationExecutor<HospitalBanCi> {
    HospitalBanCi findFirstByHospitalIdAndCodeAndType(Integer hospitalId,String code,BanCiType type);
    List<HospitalBanCi> findAllByHospitalId(Integer hospitalId);
    List<HospitalBanCi> findAllByHospitalIdAndStatusAndTypeOrderByStartTime(Integer hospitalId, Boolean status, BanCiType type);
}
